|
Netscape 6 and Automatic Sonification
|
Certain content sonified using the Wizards extension (or other automatic sonification techniques) could be crippled when browsed in Netscape 6.
If you are using the Wizards extension for automatic sonification, then different symptoms could be seen, depending on which version of the extension is being used...
Certain content sonified using versions of the Wizards extension before 1.2.0 (or other custom automatic sonification code) could be crippled when browsed in Netscape 6, so that links or other HTML elements do not function correctly. Because of a bug in Netscape 6, event handlers for HTML elements could be overwritten during the automatic sonification process. For sonified elements, this could result in image rollovers not functioning correctly, status bar messages not displaying correctly, form field validation not functioning, window opening links not functioning, etc.
Content sonified using versions 1.2.0 and higher of the Wizards extension may not produce sound when browsed in Netscape 6, unless the content has been updated to set the Music.noManualHandlers static property to the value true (see the Solution section of this document).
If you have sonified any content using versions of the Wizards extension earlier than 1.2.0 (or you are using other custom code for automatic sonification), and some of the HTML elements that are being automatically sonified are also performing other operations that are implemented in event handler HTML attributes for those elements, then these elements will not function as intended when the page is browsed in Netscape 6.
For example, if you are automatically sonifying a form and there is an ONSUBMIT attribute, as part of the FORM tag, that specifies code that should be executed to perform field value validation, then this validation will not occur when the page is browsed in Netscape 6. This, of course, could be a serious problem and may significantly impair the functioning of your page.
Similarly, links that are supposed to open content in new windows, and that are also being automatically sonified with click sounds, may fail to open the content they are supposed to when the page is browsed in Netscape 6. Once again, this would be a serious impairment to such a page.
Because of this potential for serious problems, it is highly recommended that you read through the Solution section of this document and update - as needed - any pages that are sonified using the Wizards extension or other custom automatic sonification code.
Netscape 6 has a somewhat insidious little bug that results in event handlers, that are declared in the HTML code, not being correctly reflected in the DOM (Document Object Model), so that these event handlers are not accessible by JavaScript. In fact, as it turns out, the bug is so strange that these event handlers only become reflected to JavaScript after the user interacts with the HTML elements to which they belong. So, as an example, if a link has an ONMOUSEOVER attribute, then the onmouseover property for the link only becomes set correctly after the user "mouses over" the link for the first time. Pretty bizarre!
This is a problem for the Wizards extension (and automatic sonification in general) because, when event handlers for the HTML elements that are to be sonified are replaced with sonification handlers, it is not possible to store the previously registered event handlers so that these actions can be respectfully carried out as well as part of the sonification handlers. If the event handlers that are coded into the HTML are not reflected to JavaScript at the time that the automatic sonification is carried out, then it simply appears to the automatic sonification code that there aren't any previously existing handlers, and so nothing is stored. So, the content author's originally intended actions for these HTML elements effectively become "lost in space".
To prevent the Wizards extension from crippling sonified pages browsed in Netscape 6, a mechanism was put into place (starting from version 1.2.0) so that automatic sonification using this extension is disabled, by default, for Netscape 6. While the Wizards extension may not impair the proper functioning of all sonified pages in Netscape 6, Beatnik, Inc. felt it better to be safe than sorry. If you are still using a version of the Wizards extension earlier than 1.2.0, then you should absolutely upgrade to the latest version in order to protect your sonified content from this Netscape 6 issue.
Because of the mechanism in versions 1.2.0 and higher, content sonified using these versions of the extension will no longer be sonified in Netscape 6, unless the content is specifically updated to use the new Music.noManualHandlers static property. This property lets you essentially declare to the Wizards extension that none of the HTML elements that will be sonified by it have event handlers in the HTML code, and that it is, therefore, safe to automatically sonify these elements - even when the page is being browsed in Netscape 6.
Updating your code to use the Music.noManualHandlers property is easy, but you should be very careful to first make sure that it is safe. Check the HTML code that you wish to sonify and make absolutely certain that none of the HTML elements you will be sonifying using the extension have event handlers in the HTML code.
The following simple example shows just how easy it is to add this property to your code (the added code is highlighted)...
<HTML>
<HEAD><TITLE>Automatic Sonification Example</TITLE></HEAD>
<BODY ONLOAD="sonifyLinks ()">
<SCRIPT SRC="music-object.js"></SCRIPT>
<SCRIPT SRC="music-object-x-dynamic.js"></SCRIPT>
<SCRIPT LANGUAGE=JavaScript><!-- //
Music.noManualHandlers = true;
function sonifyLinks () {
Music.sonifyLinksWithHandlers (
'',
'uiPlayer.playRandomNote (1,1,10,100,110,100,70,1000,1000,100,100,0,127);'
);
}
uiPlayer = new Music ();
uiPlayer.stubEmbed ('stub.rmf');
// --></SCRIPT>
<A HREF="some-page1.html">Some Link 1</A><BR>
<A HREF="some-page2.html">Some Link 2</A><BR>
<A HREF="some-page3.html">Some Link 3</A><BR>
<A HREF="some-page4.html">Some Link 4</A><BR>
</BODY>
</HTML>
|
If you are not using the Wizards extension but are, instead, using other automatic page sonification code that you have written yourself or have obtained elsewhere, then you should consider adding conditional logic to this code so that it is disabled for users browsing the content with Netscape 6. The conditional logic would simply check that the user's browser is not Netscape 6 before going ahead and performing the automatic sonification.
The following simple example illustrates how easy it is to add such a condition to custom automatic sonification code (the added code is highlighted)...
<HTML>
<HEAD><TITLE>Automatic Sonification Example</TITLE></HEAD>
<BODY ONLOAD="sonifyLinks ()">
<SCRIPT SRC="music-object.js"></SCRIPT>
<SCRIPT SRC="music-object-x-dynamic.js"></SCRIPT>
<SCRIPT LANGUAGE=JavaScript><!-- //
function mouseOverSound () {
uiPlayer.playRandomNote (1,1,10,100,110,100,70,1000,1000,100,100,0,127);
}
function sonifyLinks () {
if (Music.clientName != 'Netscape' || !Music.meetsMinVersion (Music.clientVersion,'5')) {
for (var linkNo = 0; linkNo < document.links.length; linkNo++) {
if (typeof document.links [linkNo].onmouseover == 'undefined') {
document.links [linkNo].onmouseover = mouseOverSound;
}
}
}
}
uiPlayer = new Music ();
uiPlayer.stubEmbed ('stub.rmf');
// --></SCRIPT>
<A HREF="some-page1.html" ONMOUSEOVER="window.status = 'Some Link 1'; return true">
Some Link 1
</A><BR>
<A HREF="some-page2.html" ONMOUSEOVER="window.status = 'Some Link 2'; return true">
Some Link 2
</A><BR>
<A HREF="some-page3.html" ONMOUSEOVER="window.status = 'Some Link 3'; return true">
Some Link 3
</A><BR>
<A HREF="some-page4.html" ONMOUSEOVER="window.status = 'Some Link 4'; return true">
Some Link 4
</A><BR>
</BODY>
</HTML>
|